import axios from '@/axios'

export const getRuleListAPI = (page) => {
  return axios.get(`/admin/rule/${page}`)
}

// 增加菜单权限
export const addRuleAPI = (data) => {
  return axios.post('/admin/rule', data)
}

// 修改菜单权限
export const updateRuleAPI = (id, data) => {
  return axios.post(`/admin/rule/${id}`, data)
}

//
// 删除菜单权限
export const deleteRuleAPI = (id) => {
  return axios.post(`/admin/rule/${id}/delete`)
}

// 修改菜单权限状态
export const updateRuleStatusAPI = (id, status) => {
  return axios.post(`/admin/rule/${id}/update_status`, {
    status,
  })
}
